package com.company.service.impl;

import com.company.entity.user;
import com.company.service.StartService;
import com.company.utils.ServiceFactory;

import java.io.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class StartServiceplus  implements StartService {
    Scanner sc = new Scanner(System.in);
    List list = new ArrayList();
    List list1 = new ArrayList();
    user user = new user();

    public StartServiceplus() {

    }

    public StartServiceplus(Scanner sc, List list, List list1) {
        this.sc = sc;
        this.list = list;
        this.list1 = list1;
    }


    @Override
    public List ex(List list) {
        System.out.println("欢迎使用书虫阅读器");
        System.out.println("--------------------");
        while (true) {
            System.out.println("1.登录");
            System.out.println("2.注册");
            System.out.println("3.退出");
            System.out.println("--------------------");
            System.out.println("请选择：");
            int xuan = sc.nextInt();
            switch (xuan) {
                case 1:
                    StartService S = ServiceFactory.getbone("dengl");
                    S.ex(list);
                    break;
                case 2:
                    StartService Ss = ServiceFactory.getbone("zhuc");
                    Ss.ex(list);

                    break;
                case 3:
                    System.exit(0);
                    break;
                default:
                    break;
            }
        }
    }
}



